package com.dongdongshop.service.impl;

import com.dongdongshop.dao.UserRepostory;
import com.dongdongshop.pojo.user.TbUser;
import com.dongdongshop.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Eayon
 * @Date 2020/4/3 16:16
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepostory userRepostory;

    @Override
    public List<TbUser> getByUsername(String username) {
        List<TbUser> users = userRepostory.findByUsernameIs(username);
        return users;
    }

    @Override
    public void addUser(TbUser tbUser) {
        userRepostory.save(tbUser);
    }
}
